package com.simas.hid;

import net.rim.device.api.ui.UiApplication;
//import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;

import com.simas.common.CommonFunction;
import com.simas.common.CustomResources;
import com.simas.screen.XmlHIDScreen;

public class CallHIDServlet {
	CustomResources cr = new CustomResources();
	CommonFunction cf = new CommonFunction();
	private String strHIDServlet;
	
	public CallHIDServlet() {
		
	}
	
	// hidMode = 1
	public void fnCallHIDServlet(MainScreen mainScreen, String strNoKartu, String strNoPolis, String strNoPeserta, String strTglLahir, String strNama) {
		strHIDServlet = cr.getStrHIDServlet();
		strHIDServlet = strHIDServlet + "?hidMode=1&hidNama=" + strNama + "&hidNoKartu=" + strNoKartu + "&hidNoPolis=" + strNoPolis + "&hidNoReg=" + strNoPeserta + "&hidTglLahir=" + strTglLahir;
		UiApplication.getUiApplication().popScreen(mainScreen);
		String myURL = cf.fnStringToURL(strHIDServlet);
		XmlHIDScreen xhs = new XmlHIDScreen(myURL);
		UiApplication.getUiApplication().pushScreen(xhs);
	}
	
	// view polis
	public void fnCallHIDServlet2(MainScreen mainScreen, String strHidNoKartu, String strHidNoPolis, String strHidNoReg, String strHidTglLahir) {
		strHIDServlet = cr.getStrHIDServlet();
		strHIDServlet = strHIDServlet + "?hidMode=2&hidNoKartu=" + strHidNoKartu + "&hidNoPolis=" + strHidNoPolis + "&hidNoReg=" + strHidNoReg + "&hidTglLahir=" + strHidTglLahir;
		UiApplication.getUiApplication().popScreen(mainScreen);
//		XmlHIDScreen xhs = new XmlHIDScreen(strHIDServlet);
		String myURL = cf.fnStringToURL(strHIDServlet);
		XmlHIDScreen xhs = new XmlHIDScreen(myURL);
		UiApplication.getUiApplication().pushScreen(xhs);
	}
	
	// view klaim
	public void fnCallHIDServlet5(MainScreen mainScreen, String strHidNoKartu, String strHidNoPolis, String strHidNoReg, String strHidTglLahir, String strRecNo, String strMaxNo) {
		strHIDServlet = cr.getStrHIDServlet();
		strHIDServlet = strHIDServlet + "?hidMode=5&hidNoKartu=" + strHidNoKartu + "&hidNoPolis=" + strHidNoPolis + "&hidNoReg=" + strHidNoReg + "&hidTglLahir=" + strHidTglLahir + "&hidRecNo=" + strRecNo + "&hidMaxNo=" + strMaxNo;
		UiApplication.getUiApplication().popScreen(mainScreen);
//		XmlHIDScreen xhs = new XmlHIDScreen(strHIDServlet);
		String myURL = cf.fnStringToURL(strHIDServlet);
		XmlHIDScreen xhs = new XmlHIDScreen(myURL);
		UiApplication.getUiApplication().pushScreen(xhs);
	}
	
	// view benefit
	public void fnCallHIDServlet3(MainScreen mainScreen, String strHidNoKartu, String strHidNoPolis, String strHidNoReg, String strHidTglLahir, String strPlanName) {
		strHIDServlet = cr.getStrHIDServlet();
		strHIDServlet = strHIDServlet + "?hidMode=3&hidNoKartu=" + strHidNoKartu + "&hidNoPolis=" + strHidNoPolis + "&hidNoReg=" + strHidNoReg + "&hidTglLahir=" + strHidTglLahir + "&hidPlanName=" + strPlanName;
		UiApplication.getUiApplication().popScreen(mainScreen);
//		XmlHIDScreen xhs = new XmlHIDScreen(strHIDServlet);
		String myURL = cf.fnStringToURL(strHIDServlet);
		XmlHIDScreen xhs = new XmlHIDScreen(myURL);
		UiApplication.getUiApplication().pushScreen(xhs);
	}
}
